package abel.wlmr.model;

public abstract class WlmrField {

    private final int thisLength;

    public WlmrField(int thisLen) {
        this.thisLength = thisLen;
    }

    public abstract int getValue();

    public abstract void parseValue(int v) throws WlmrException;

    /**
     * @return the dataLength
     */
    public int getThisLength() {
        if (thisLength < 0) {
            throw new IllegalArgumentException("this field is not for demarshalling");
        }

        return thisLength;
    }

}